package com.softeem.arrays;

public class T {
	
	public int[] twoSum(int[] i,int target){
		for (int m = 0; m < i.length; m++) {
			for (int n = m + 1; n < i.length; n++) {
				if(i[n] == target - i[m]){
					return new int[]{i[m],i[n]};
				}
			}
		}
		return null;
	}

	public static void main(String[] args) {

		int[] a = {2,3,5,6,7,8,22,10,1};
		int target = 10;
		a = new T().twoSum(a, target);
		for (int i : a) {
			System.out.println(i);
		}
	}

}
